﻿<%@ Page Language="C#"  MasterPageFile="~/Views/Shared/Site.Master"  Inherits="System.Web.Mvc.ViewPage<PersonalAlbumModel>" %>
<%@ Import Namespace="MyAlbum.Model" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <span id="errorMessage"><%=Html.Encode(Model.ErrorMessage)%></span>
    <%
        int itemPerRow = Math.Max(1, Model.Configuration.EntriesPerRow);
            string width = ((90-itemPerRow*4) / itemPerRow).ToString()+"%";
            foreach (var item in Model.Entries)
            {%>
            <div style=" width:<%=width%>" class="entryBox">
              <h1>
                    <%=Html.ActionLink<EntryController>(a=>a.Details(item.Id),Html.Encode(item.Title)) %>
                     <span class="entryTime"><%=item.Date%></span>
              </h1>
                <br />
               
               &nbsp;
                <span class="entryTagsTitle"><%=Model.Localize("Entry.Tags")%>:</span>&nbsp;
                <span class="entryTags">
                    <%=Html.Encode(string.Join(",", item.Tags.Select(s => s.Name).ToArray()))%>
                </span>
               <%if (Model.Configuration.ShowReplies)
                 {%>
                <span class="entryRepliesCount">
                    <%=item.Replies.Count()%>&nbsp;<%=Model.Localize("Entry.Replies")%>
                </span>
                <br />
                 <%} %>
                <a href="<%=Url.Action("Details","Entry",new{id=item.Id}) %>" title="<%=Model.Localize("Entry.View") %>"> <%=item.RenderThumb()%></a>
           </div>
            <%} %>
    
  <%if (Model.User.AllowAddEntries())
    {%>
    <%=Html.ActionLink<EntryController>(a=>a.ShowCreate(Model.ParentAlbum),Model.Localize("AddEntry.AddEntry")) %>
    <%}%>
</asp:Content>
